package com.smartrm.trade.domain;

/*
 * @program: common-starters
 * @description: 订单类型
 * @author: houhong
 * @create: 2023-01-10 16:06
 */
public enum OrderType {

    /*
     * 货道售卖机扫码支付订单
     */
    SlotQrScanePaid(0),
    /*
     * 货柜机免密支付订单
     */
    CabinetAutoDeduction(1);

    private final int code;

    private OrderType(int code) {
        this.code = code;
    }

    public int code() {
        return code;
    }

    public static OrderType of(int code) {
        for (OrderType type : values()) {
            if (type.code == code) {
                return type;
            }
        }
        return null;
    }
}